package com.villaday.idf.activity3;

import android.graphics.Color;
import android.os.Build;

import androidx.appcompat.widget.Toolbar;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.villaday.idf.R;
import com.villaday.idf.base.BaseActivity;
import com.villaday.idf.custom.LoadingDialog;
import com.villaday.idf.model3.Orders_invoice_deticalEntity;
import com.villaday.idf.util.StatusBarUtils;
import com.villaday.idf.util.ToolBarUtil;

import butterknife.BindView;

/*
 * 发票详情
 * */
public class InvoiceDetailsActivity extends BaseActivity {

    @BindView(R.id.toolbar_text)
    Toolbar toolbarText;
    @BindView(R.id.tv_taitou)
    TextView tvTaitou;
    @BindView(R.id.tv_content)
    TextView tvContent;
    @BindView(R.id.tv_num)
    TextView tvNum;
    @BindView(R.id.tv_phone)
    TextView tvPhone;
    @BindView(R.id.tv_email)
    TextView tvEmail;

    @BindView(R.id.ll_num)
    LinearLayout ll_num;


    private LoadingDialog loadingDialog;

    @Override
    protected int getViewResId() {
        return R.layout.activity_invoice_details;
    }

    @Override
    protected void init() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
            StatusBarUtils.setStatusBarLightMode(this, Color.parseColor("#FFF7F9FB"));
        ToolBarUtil.initToolBar(toolbarText, "发票", new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onBackPressed();
            }
        });

        Orders_invoice_deticalEntity.BodyBean data = getIntent().getParcelableExtra("data");

        if (TextUtils.isEmpty(data.getTaxpayerNumber())){
            ll_num.setVisibility(View.GONE);

        }else {
            ll_num.setVisibility(View.VISIBLE);
        }

         tvTaitou.setText(data.getTitle());
         tvContent.setText(data.getContent());
         tvNum.setText(TextUtils.isEmpty(data.getTaxpayerNumber())?"":data.getTaxpayerNumber());
         tvPhone.setText(data.getPhone());
         tvEmail.setText(data.getEmail());

    }



}
